<?php

// Aug 19, 2010: immanuel192 write this module

class cufonmodule {
	function name() { return 'Cufont Module'; }
	function description() { return 'Convert all your HTML tag ID to new font'; }
	function author() { return 'Immanuel192'; }

	function hasSources() { return true; }
	function hasContent() { return false; }
	function hasViews() { return true; }

	function supportsWorkflow() { return false; }

	function permissions($internal = '') {
		return array(
			'administrate'=>"Administrate"
		);
	}
	
	function show($view,$loc = null, $title = '') {
		global $db;

		// get data
		$data=$db->selectObjects("cufonmodule_items","location_data ='".serialize($loc)."'");
		/*// create new font file array
		 * Aug 20, 2010: immanuel192 block this code for fontsize property.
		$font_file=array();
		foreach ($data as $k=>$v)
		{
			$font_tag=null;
			if (array_key_exists($v->font_name,$font_file))
			{
				$font_tag=$font_file[$v->font_name];
				$font_tag->tag=$font_tag->tag." , ".$v->tag_name;
			}
			else
			{
				$font_tag->tag=$v->tag_name;
				$font_tag->item=$v;
			}
			$font_file[$v->font_name]=$font_tag;
		}*/
		//
		$template = new template('cufonmodule',$view,$loc);

		$template->register_permissions(array('administrate'),$loc);
        // Assign page data
		$template->assign('data', $data);
		$template->assign('module_title', $title);
		$template->assign('font_files', $data);
		$template->output();
	}

	function deleteIn($loc) {
		return false;
	}

	function copyContent($oloc,$nloc) {
		global $db;
		return false;
	}

	function searchName() {
		return false;
	}

	function spiderContent($item = null) {
		return false;
	}
}

?>
